﻿@model ContosoUniversity.Models.Student

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Student</legend>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.LastName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.LastName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.FirstMidName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FirstMidName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.EnrollmentDate)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EnrollmentDate)
    </div>
    <div class="display-field">
    <table>
    <tr>
            <th>Course Title</th>
            <th>Grade</th>
        </tr>
        @foreach (var item in Model.Enrollments)
        {
            <tr>
            <td>@item.Course.Title</td>
            <td>@item.Grade</td>
            </tr>
        }
    </table>
    </div>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.StudentID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
